cmake_minimum_required(VERSION 3.10)
set(PROJECT_NAME "GameEngine")
project(${PROJECT_NAME})

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(SPDLOG_NO_THREADS ON)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
set(EASYX_PATH ${CMAKE_SOURCE_DIR}/3rd/EasyX)
# 设置easyX库文件路径
set(EASYX_LIB_PATH ${EASYX_PATH}/lib/x64)
# 设置easyX头文件路径
include_directories(${EASYX_PATH}/include)

file(GLOB_RECURSE  SOURCES
    src/*.cpp
    src/engine/*.cpp
    src/object/*.cpp
 )  # 获取src目录下的所有cpp文件

# 打印找到的.cpp文件
message("find following cpp files")
foreach(source_file ${SOURCES})
    message("\t-->\t${source_file}")
endforeach()


add_executable(${PROJECT_NAME}
${SOURCES}
main.cpp
)




# 添加包含目录
target_include_directories(${PROJECT_NAME} PRIVATE
    inc
    src
    ${EASYX_PATH}/include
    ${EASYX_PATH}/lib/x64
)

add_subdirectory(3rd/spdlog)
target_link_libraries(${PROJECT_NAME} PRIVATE
spdlog
)
target_link_libraries(${PROJECT_NAME} PRIVATE EasyXa)
target_link_libraries(${PROJECT_NAME} PRIVATE EasyXw)
# 如果需要使用Windows API，添加下面一行
target_link_libraries(${PROJECT_NAME} PRIVATE gdi32)